$(function(){
	const userData=JSON.parse(localStorage.getItem('userData'));
	
	//加载头像
	// $('.avatar').attr('src',`${baseURL}`+userData.avatar)
	
	//加载昵称
	$('.name').text(userData.nickName)
	
	// 加载评论
	$.ajax(baseURL+`/comments`,{
		method:'get',
		success:function(res){
			console.log('---------- load comment list ----------')
			console.log(res.records)
			
			const htmlStr = template('templateCommentManageTr', {'results':res.records,'baseURL':baseURL});
			$('tbody').html(htmlStr);
		},
		error:function(err){ 
			console.log(err); 
		}
	})
	
	
})